package com.pzr.soccer.controller;

import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author pzr
 * @date:2021-12-21-16:28
 * @Description:
 **/
@RestController
@RequestMapping("/auth")
public class AuthorityTestController {

    @GetMapping("/currentUser")
    public Object getCurrentUserInfo(){

        return  SecurityContextHolder.getContext().getAuthentication();
    }

    @GetMapping("/dbAdmin")
    public String testDBAdmin(){
        return "hello ,dbAdmin";
    }

    @GetMapping("/admin")
    public String testAdmin(){
        return "hello ,admin";
    }


    @GetMapping("/superVip")
    public String testSuperVip(){
        return "hello ,superVip";
    }


    @GetMapping("/vip")
    public String testVip(){
        return "hello ,vip";
    }


    @GetMapping("/normal")
    public String testNormal(){
        return "hello ,normal";
    }

    @GetMapping("/guest")
    public String testGuest(){
        return "hello ,guest";
    }
}
